package com.xuecheng.auth.controller;

import com.xuecheng.service.FindPasswordService;
import com.xuecheng.service.RegisterService;
import com.xuecheng.ucenter.model.dto.RegisterDto;
import com.xuecheng.ucenter.model.po.XcUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈竞超
 * @version 1.0
 * @qq 2250537249
 */
@RestController
public class RegisterController {
    @Autowired
    RegisterService registerService;

    @PostMapping("/register")
    public String findPassword(@RequestBody RegisterDto registerDto) {
        RegisterDto user = registerService.createUser(registerDto);
        if (user!=null){
            return "http://www.51xuecheng.cn/sign.html";
        }
        return "redirect:http://www.51xuecheng.cn/error.html";
    }
}
